.class public Lcom/bitauto/autoeasy/selectcar/Object/BrandDetailParser;
.super Ljava/lang/Object;
.source "BrandDetailParser.java"


# instance fields
.field private final SERIALIST:Ljava/lang/String;

.field private TAG:Ljava/lang/String;

.field private url:Ljava/lang/String;


# direct methods
.method public constructor <init>(Ljava/lang/String;)V
    .locals 1
    .parameter "url"

    .prologue
    .line 26
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 21
    const-string v0, "SerialList"

    iput-object v0, p0, Lcom/bitauto/autoeasy/selectcar/Object/BrandDetailParser;->SERIALIST:Ljava/lang/String;

    .line 23
    const-string v0, ""

    iput-object v0, p0, Lcom/bitauto/autoeasy/selectcar/Object/BrandDetailParser;->url:Ljava/lang/String;

    .line 24
    const-string v0, "BrandParser"

    iput-object v0, p0, Lcom/bitauto/autoeasy/selectcar/Object/BrandDetailParser;->TAG:Ljava/lang/String;

    .line 27
    iput-object p1, p0, Lcom/bitauto/autoeasy/selectcar/Object/BrandDetailParser;->url:Ljava/lang/String;

    .line 28
    return-void
.end method


# virtual methods
.method public Paser2Object()Ljava/util/ArrayList;
    .locals 14
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/bitauto/autoeasy/selectcar/Object/Brand;",
            ">;"
        }
    .end annotation

    .prologue
    .line 32
    :try_start_0
    iget-object v11, p0, Lcom/bitauto/autoeasy/selectcar/Object/BrandDetailParser;->url:Ljava/lang/String;

    invoke-static {v11}, Lcom/bitauto/autoeasy/tool/Caller;->doGet(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v10

    .line 33
    .local v10, str:Ljava/lang/String;
    new-instance v6, Lorg/json/JSONArray;

    invoke-direct {v6, v10}, Lorg/json/JSONArray;-><init>(Ljava/lang/String;)V

    .line 35
    .local v6, jArray:Lorg/json/JSONArray;
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    .line 36
    .local v0, BrandList:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Lcom/bitauto/autoeasy/selectcar/Object/Brand;>;"
    const/4 v4, 0x0

    .local v4, i:I
    :goto_0
    invoke-virtual {v6}, Lorg/json/JSONArray;->length()I

    move-result v11

    if-lt v4, v11, :cond_0

    move-object v11, v0

    .line 70
    .end local v0           #BrandList:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Lcom/bitauto/autoeasy/selectcar/Object/Brand;>;"
    .end local v4           #i:I
    .end local v6           #jArray:Lorg/json/JSONArray;
    .end local v10           #str:Ljava/lang/String;
    :goto_1
    return-object v11

    .line 37
    .restart local v0       #BrandList:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Lcom/bitauto/autoeasy/selectcar/Object/Brand;>;"
    .restart local v4       #i:I
    .restart local v6       #jArray:Lorg/json/JSONArray;
    .restart local v10       #str:Ljava/lang/String;
    :cond_0
    invoke-virtual {v6, v4}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v8

    .line 38
    .local v8, obj:Lorg/json/JSONObject;
    invoke-static {v8}, Lcom/bitauto/autoeasy/selectcar/Object/BrandParser;->build(Lorg/json/JSONObject;)Lcom/bitauto/autoeasy/selectcar/Object/Brand;

    move-result-object v1

    .line 39
    .local v1, brand:Lcom/bitauto/autoeasy/selectcar/Object/Brand;
    if-eqz v1, :cond_1

    .line 40
    invoke-virtual {v1}, Lcom/bitauto/autoeasy/selectcar/Object/Brand;->getImage()Ljava/lang/String;

    move-result-object v11

    invoke-virtual {v11}, Ljava/lang/String;->length()I

    move-result v11

    if-lez v11, :cond_3

    .line 41
    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catch Lcom/bitauto/autoeasy/tool/WSError; {:try_start_0 .. :try_end_0} :catch_1

    .line 49
    :cond_1
    :goto_2
    :try_start_1
    const-string v11, "SerialList"

    invoke-virtual {v8, v11}, Lorg/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v7

    .line 50
    .local v7, jArray2:Lorg/json/JSONArray;
    if-eqz v7, :cond_2

    .line 51
    const/4 v5, 0x0

    .local v5, j:I
    :goto_3
    invoke-virtual {v7}, Lorg/json/JSONArray;->length()I
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_2
    .catch Lcom/bitauto/autoeasy/tool/WSError; {:try_start_1 .. :try_end_1} :catch_1

    move-result v11

    if-lt v5, v11, :cond_4

    .line 36
    .end local v5           #j:I
    .end local v7           #jArray2:Lorg/json/JSONArray;
    :cond_2
    :goto_4
    add-int/lit8 v4, v4, 0x1

    goto :goto_0

    .line 43
    :cond_3
    :try_start_2
    const-string v11, "SerialList"

    invoke-virtual {v1, v11}, Lcom/bitauto/autoeasy/selectcar/Object/Brand;->setImage(Ljava/lang/String;)V

    .line 44
    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0
    .catch Lcom/bitauto/autoeasy/tool/WSError; {:try_start_2 .. :try_end_2} :catch_1

    goto :goto_2

    .line 65
    .end local v0           #BrandList:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Lcom/bitauto/autoeasy/selectcar/Object/Brand;>;"
    .end local v1           #brand:Lcom/bitauto/autoeasy/selectcar/Object/Brand;
    .end local v4           #i:I
    .end local v6           #jArray:Lorg/json/JSONArray;
    .end local v8           #obj:Lorg/json/JSONObject;
    .end local v10           #str:Ljava/lang/String;
    :catch_0
    move-exception v11

    move-object v3, v11

    .line 66
    .local v3, e:Ljava/lang/Exception;
    iget-object v11, p0, Lcom/bitauto/autoeasy/selectcar/Object/BrandDetailParser;->TAG:Ljava/lang/String;

    new-instance v12, Ljava/lang/StringBuilder;

    const-string v13, "error :"

    invoke-direct {v12, v13}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v3}, Ljava/lang/Exception;->toString()Ljava/lang/String;

    move-result-object v13

    invoke-virtual {v12, v13}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v12

    invoke-virtual {v12}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v12

    invoke-static {v11, v12}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 67
    const/4 v11, 0x0

    goto :goto_1

    .line 52
    .end local v3           #e:Ljava/lang/Exception;
    .restart local v0       #BrandList:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Lcom/bitauto/autoeasy/selectcar/Object/Brand;>;"
    .restart local v1       #brand:Lcom/bitauto/autoeasy/selectcar/Object/Brand;
    .restart local v4       #i:I
    .restart local v5       #j:I
    .restart local v6       #jArray:Lorg/json/JSONArray;
    .restart local v7       #jArray2:Lorg/json/JSONArray;
    .restart local v8       #obj:Lorg/json/JSONObject;
    .restart local v10       #str:Ljava/lang/String;
    :cond_4
    :try_start_3
    invoke-virtual {v7, v5}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v9

    .line 53
    .local v9, obj2:Lorg/json/JSONObject;
    invoke-static {v9}, Lcom/bitauto/autoeasy/selectcar/Object/BrandParser;->build(Lorg/json/JSONObject;)Lcom/bitauto/autoeasy/selectcar/Object/Brand;

    move-result-object v2

    .line 54
    .local v2, brand2:Lcom/bitauto/autoeasy/selectcar/Object/Brand;
    if-eqz v1, :cond_5

    .line 55
    invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
    :try_end_3
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_2
    .catch Lcom/bitauto/autoeasy/tool/WSError; {:try_start_3 .. :try_end_3} :catch_1

    .line 51
    :cond_5
    add-int/lit8 v5, v5, 0x1

    goto :goto_3

    .line 68
    .end local v0           #BrandList:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Lcom/bitauto/autoeasy/selectcar/Object/Brand;>;"
    .end local v1           #brand:Lcom/bitauto/autoeasy/selectcar/Object/Brand;
    .end local v2           #brand2:Lcom/bitauto/autoeasy/selectcar/Object/Brand;
    .end local v4           #i:I
    .end local v5           #j:I
    .end local v6           #jArray:Lorg/json/JSONArray;
    .end local v7           #jArray2:Lorg/json/JSONArray;
    .end local v8           #obj:Lorg/json/JSONObject;
    .end local v9           #obj2:Lorg/json/JSONObject;
    .end local v10           #str:Ljava/lang/String;
    :catch_1
    move-exception v11

    move-object v3, v11

    .line 69
    .local v3, e:Lcom/bitauto/autoeasy/tool/WSError;
    iget-object v11, p0, Lcom/bitauto/autoeasy/selectcar/Object/BrandDetailParser;->TAG:Ljava/lang/String;

    new-instance v12, Ljava/lang/StringBuilder;

    const-string v13, "error :"

    invoke-direct {v12, v13}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v3}, Lcom/bitauto/autoeasy/tool/WSError;->getMessage()Ljava/lang/String;

    move-result-object v13

    invoke-virtual {v12, v13}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v12

    invoke-virtual {v12}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v12

    invoke-static {v11, v12}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 70
    const/4 v11, 0x0

    goto :goto_1

    .line 58
    .end local v3           #e:Lcom/bitauto/autoeasy/tool/WSError;
    .restart local v0       #BrandList:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Lcom/bitauto/autoeasy/selectcar/Object/Brand;>;"
    .restart local v1       #brand:Lcom/bitauto/autoeasy/selectcar/Object/Brand;
    .restart local v4       #i:I
    .restart local v6       #jArray:Lorg/json/JSONArray;
    .restart local v8       #obj:Lorg/json/JSONObject;
    .restart local v10       #str:Ljava/lang/String;
    :catch_2
    move-exception v11

    goto :goto_4
.end method
